<%--
  User: chenjy
  Date: 2018/2/7
  Time: 下午9:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <%@include file="../common/includ.jsp" %>
</head>
<body>
<search:panel title="检索">
    <search:form name="userForm">
        <search:input id="loginName" title="登录名" placeholder="请输入登录名"/>
        <search:input id="name" title="姓名" placeholder="请输入姓名"/>
        <search:input id="phone" title="手机号" placeholder="请输入手机号" verify="integer"/>
        <search:select id="user" title="用户" data="${users}" optionvalue="id" optionlabel="loginName"
                       placeholder="请输入用户名"/>
        <search:select id="agent" title="机构" data="${users}" optionvalue="id" optionlabel="name"
                       placeholder="请选择机构类型"/>
        <search:time id="createTime" title="创建时间"/>
        <search:limit id="test" title="设备数量"/>
        <search:button formName="userForm" tableName="userTable"/>
    </search:form>
</search:panel>
<btn:group>
    <btn:add url="${ctxAdmin}/user/form/0" title="添加用户" width="800" height="600"/>
    <btn:edit url="${ctxAdmin}/user/form" tableName="userTable" width="800" height="600"/>
    <btn:delete url="${ctxAdmin}/user/delete" tableName="userTable"/>
    <btn:import/>
    <btn:export/>
    <btn:refresh/>
</btn:group>
<table id="userTable"></table>
<script type="text/javascript">
    layui.use(['element', 'form', 'table'], function () {
        var form = layui.form, table = layui.table;
        table.render({
            id: 'userTable',
            elem: '#userTable',
            method: 'post',
            url: ctxAdmin + '/user/grid',
            height: 'full-115',
            page: true,
            limit: 20,
            size: 'sm',
            limits: [20, 50, 70, 100, 200, 500],
            cols: [[
                {field: '', title: '序号', type: 'numbers'},
                {field: '', type: 'checkbox'},
                {field: 'loginName', width: "10%", title: '登录名'},
                {field: 'name', width: "10%", title: '姓名'},
                {field: 'email', width: "10%", title: '邮箱'},
                {field: 'phone', width: "10%", title: '手机号'},
                {field: 'loginIp', title: '最后登录IP', width: "10%"},
                {field: 'loginDate', width: "15%", title: '最后登录时间', sort: true},
                {field: 'companyName', width: "14.4%", title: '公司'},
                {field: 'id', title: '操作', width: '13%', toolbar: '#bar'}
            ]]
        });
    });
</script>
</body>
</html>
